<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8"/>
	<title></title>
	<style type="text/css">
		.active{
			border: 2px solid red;
		}
	</style>
	<script src="vue.js" type="text/javascript"></script>
</head>
<body>
	<div id="app">
		<img v-bind:src="imgSrc" >
		<br>
		<img :src="imgSrc" :title="imgTitle+123" :class="isActive?'active':''" @click="toggleActive">
		<img :src="imgSrc" :title="imgTitle+123" :class="{active:isActive}" @click="toggleActive">
	</div>
<script>
	var app=new Vue({
		el:"#app",
		data:{
			imgSrc:"http://5b0988e595225.cdn.sohucs.com/images/20181017/8c664a4ce2f84b799c0846c6d4f527d3.png",
			imgTitle:"翩翩少年",
			isActive:false
		},
		methods: {
			toggleActive:function() {
				this.isActive=!this.isActive;
			}
		},
	})
</script>

</body>
</html>
